home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.3
/
Video Toaster v4.3.iso
/
3.1
/
toasterall
/
arexx_examples
/
gpigrabber.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-06-06
|
3KB
|
73 lines
/* StopFrame.rexx Grabs frames on cue from GPI trigger for stop-action animation */
/* By Arnie Cachelin © 1992 NewTek Inc. */
/*
This program will grab and save frames on cue from the GPI trigger.
If you enter a number to grab, it will save that many then exit.
Otherwise, 3 frames will be saved, then the prog. will exit. Since
the Toaster is waiting for GPI input most of the time, it will not
respond to anything else, which you may find annoying. You can easily
give your Toaster GPI pulses by attaching a spare mouse or joystick to
the second mouse port then clicking the button. You can also find long
joystick extender cables at places like Radio Shack.
To grab frames for a claymation of stop-action style animation, setup your
camera and 'actors', hook up a GPI trigger, and start this script with
appropriate arguments. When your first frame is ready, hit the trigger
to grab and save it. The toaster will then go into an 'onionskin' mode
where the camera is half dissolved over the last frame for ease of
positioning the actors. When you hit the GPI again, the Toaster will leave
onionskin mode and get ready to grab the next frame at the next GPI signal.
For best results, watch out for stray shadows, or shadows from the sun which
will change over the course of your shoot
*/
OPTIONS RESULTS
parse arg count name
if count="" then count=3
TOASTERLIB="ToasterARexx.port"
IF POS(TOASTERLIB , SHOW('Libraries')) = 0 THEN
IF ~ADDLIB(TOASTERLIB , 0) THEN say "Please start your Toaster"
say "Saving "count" frames as "name
Switcher(TOSW) /* Go to Switcher screen */
Switcher(P001)
Switcher(LVID)
Switcher(PDV1)
Switcher(P001)
Switcher(SGPI,POS) /* Set GPI trigger to positive (leading edge of pulse) */
Do i=0 to count-1
Switcher(WAIT,GPI) /* Wait for GPI trigger to come in */
Switcher(FVID) /* Freeze frame */
Frame=right(trim(i),3,"0")
if name="" then c=SaveNextFrame("grab")
else do
say name||right(i,3,'0')
t=Switcher(SRGB,"ram:shit",0,0)
end
Switcher(P001)
Switcher(MDV1)
Switcher(TBAR,255)
Switcher(WAIT,GPI) /* Wait for GPI trigger to come in */
/* address command 'wait 10 secs' */
Switcher(AUTO)
Switcher(P001)
Switcher(LVID) /* Set to live digital video */
end
Switcher(TOWB) /* Go to Workbench screen */
exit
SaveNextFrame: Procedure
arg name
N=Switcher(STAT,KNUM) /* Get the current keypad number */
fs=N+1
do while Switcher(FMXI,fs) & fs~=N /* Is the frame already there? */
if fs=999 then fs=0 /* wrap around at last frame */
else fs=fs+1
end
if fs=N then t=10 /* got to starting frame without finding open fs */
else t=Switcher(FMSV,fs,name) /* Save frame */
return t